package com.zack.service.impl;

import com.zack.core.datasource.YCXDataSource;
import com.zack.dao.TestObjectMapper;
import com.zack.model.TestObject;
import com.zack.service.ITestObjectService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

/**
 * Created by Zack on 16/4/6.
 */
@Service
public class TestObjectServiceImpl implements ITestObjectService {

    @Resource
    private TestObjectMapper mapper;

    @YCXDataSource(value = "slave")
    public void insert(TestObject testObject) {
        mapper.insert(testObject);
    }

    @YCXDataSource(value = "master")
    public TestObject selectByUsername(Map paramMap) {
        return mapper.selectByUsername(paramMap);
    }
}
